package com.raymond.client.msg;

/**
 * 基础协议类
 *
 * @author :  raymond
 * @version :  V1.0
 * @date :  2021-07-13 11:35
 */
public class BaseAgreement {

    /**
     * 消息总长度(含消息头及消息体)
     */
    private int totalLength;
    /**
     * 命令或响应类型
     */
    private int commandId;

    /**
     * 消息流水号,顺序累加,步长为1,循环使用（一对请求和应答消息的流水号必须相同）
     */
    private int sequenceId;
    /**
     * 请求头长度
     */
    private int headLength;

    /**
     * 请求体长度
     */
    private int bodyLength;

    private byte[] bodyBuffer;

    public BaseAgreement() {
    }

    public BaseAgreement(int commandId) {
        this.commandId = commandId;
    }

    public int getTotalLength() {
        return totalLength;
    }

    public void setTotalLength(int totalLength) {
        this.totalLength = totalLength;
    }

    public int getCommandId() {
        return commandId;
    }

    public void setCommandId(int commandId) {
        this.commandId = commandId;
    }

    public int getSequenceId() {
        return sequenceId;
    }

    public void setSequenceId(int sequenceId) {
        this.sequenceId = sequenceId;
    }

    public int getHeadLength() {
        return headLength;
    }

    public void setHeadLength(int headLength) {
        this.headLength = headLength;
    }

    public int getBodyLength() {
        return bodyLength;
    }

    public void setBodyLength(int bodyLength) {
        this.bodyLength = bodyLength;
    }

    public byte[] getBodyBuffer() {
        return bodyBuffer;
    }

    public void setBodyBuffer(byte[] bodyBuffer) {
        this.bodyBuffer = bodyBuffer;
    }
}
